package com.iims.customer.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.iims.common.annotation.Excel;
import com.iims.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;

/**
 * @author fanpei
 * @date 2021/6/11 10:48
 */
@ApiModel("客户")
@Data
@TableName("cmis_customer")
public class Customer extends BaseEntity {
    @ApiModelProperty(value = "主键,修改时必传", position = -1)
    @TableId(value = "customer_id", type = IdType.AUTO)
    private Long customerId;

    @ApiModelProperty(value = "客户类型Id", required = true)
    @Positive(message = "客户类型Id必须有效 >0")
    private Long cusTypeId;

    @ApiModelProperty(value = "客户名称", required = true)
    @NotBlank(message = "客户名称不能为空")
    @Size(min = 0, max = 255, message = "客户名称长度不超过255字符")
    private String customerName;

    @ApiModelProperty("联系地址/长度不超过500字符")
    @Size(min = 0, max = 500, message = "联系地址长度不超过500字符")
    private String address;

    @ApiModelProperty("联系人/长度不能超过60个字符")
    @Size(min = 0, max = 60, message = "联系人长度不能超过60个字符")
    private String contactor;

    @ApiModelProperty("手机号码/长度不能超过11个字符")
    @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
    @Excel(name = "手机号码")
    private String phoneNum;

    @ApiModelProperty("收货地址/长度不超过500字符")
    @Size(min = 0, max = 500, message = "收货地址长度不超过500字符")
    private String shippingAddres;

    @ApiModelProperty("开户行/长度不超过200字符")
    @Size(min = 0, max = 200, message = "开户行长度不超过200字符")
    private String bank;

    @ApiModelProperty("卡号/长度不超过20字符")
    @Size(min = 0, max = 20, message = "卡号长度不超过20字符")
    private String cardNum;


    //vo
    @ApiModelProperty("客户类型")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @TableField(exist = false)
    private String cusTypeName;

}
